3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides routines that you can use to manage bounding boxes.
You can use the Q3BoundingBox_Copy function to make a copy of a bounding box.
TQ3BoundingBox *Q3BoundingBox_Copy (
const TQ3BoundingBox *src,
TQ3BoundingBox *dest);
The Q3BoundingBox_Copy function returns, as its function result and in the dest parameter, a copy of the bounding box specified by the src parameter. Q3BoundingBox_Copy does not allocate any memory for the destination bounding box; the dest parameter must point to space allocated in the heap or on the stack before you call Q3BoundingBox_Copy .
You can use the Q3BoundingBox_Union function to find the union of two bounding boxes.
TQ3BoundingBox *Q3BoundingBox_Union (
const TQ3BoundingBox *v1,
const TQ3BoundingBox *v2,
TQ3BoundingBox *result);
The Q3BoundingBox_Union function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the two bounding boxes specified by the parameters v1 and v2 . The result parameter can point to the memory occupied by either v1 or v2 , thereby performing the union operation in place.
You can use the Q3BoundingBox_Set function to set the defining points of a bounding box.
TQ3BoundingBox *Q3BoundingBox_Set (
TQ3BoundingBox *bBox,
const TQ3Point3D *min,
const TQ3Point3D *max,
TQ3Boolean isEmpty);
You can use the Q3BoundingBox_UnionPoint3D function to find the union of a bounding box and a three-dimensional point.
TQ3BoundingBox *Q3BoundingBox_UnionPoint3D (
const TQ3BoundingBox *bBox,
const TQ3Point3D *pt3D,
TQ3BoundingBox *result);
The Q3BoundingBox_UnionPoint3D function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the bounding box specified by the bBox parameter and the three-dimensional point specified by the pt3D parameter. The result parameter can point to the memory pointed to by bBox , thereby performing the union operation in place.
You can use the Q3BoundingBox_UnionRationalPoint4D function to find the union of a bounding box and a rational four-dimensional point.
TQ3BoundingBox *Q3BoundingBox_UnionRationalPoint4D (
const TQ3BoundingBox *bBox,
const TQ3RationalPoint4D *pt4D,
TQ3BoundingBox *result);
The Q3BoundingBox_UnionRationalPoint4D function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the bounding box specified by the bBox parameter and the rational four-dimensional point specified by the pt4D parameter. The result parameter can point to the memory pointed to by bBox , thereby performing the union operation in place.
You can use the Q3BoundingBox_SetFromPoints3D function to find the bounding box that bounds an arbitrary list of three-dimensional points.
TQ3BoundingBox *Q3BoundingBox_SetFromPoints3D (
TQ3BoundingBox *bBox,
const TQ3Point3D *pts,
unsigned long nPts,
unsigned long structSize);
The Q3BoundingBox_SetFromPoints3D function returns, as its function result and in the bBox parameter, a pointer to a bounding box that contains all the points in the list of three-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.
You can use the Q3BoundingBox_SetFromRationalPoints4D function to find the bounding box that bounds an arbitrary list of rational four-dimensional points.
TQ3BoundingBox *Q3BoundingBox_SetFromRationalPoints4D (
TQ3BoundingBox *bBox,
const TQ3RationalPoint4D *pts,
unsigned long nPts,
unsigned long structSize);
The Q3BoundingBox_SetFromRationalPoints4D function returns, as its function result and in the bBox parameter, a pointer to a bounding box that contains all the points in the list of rational four-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.
Previous | QD3D Book | Overview | Chapter Contents | Next |